package com.movisol.messenger.views.controls;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.movisol.messenger.R;

public class ProfileDataRow extends LinearLayout {
	
	private TextView dataTv;
	private TextView optionalTv;
	private String data;
	private String optional;
	
	public ProfileDataRow(Context context, AttributeSet atrs) {
		super(context, atrs);
	}

	public ProfileDataRow(Context context, String data, String optional) {
		super(context);
		
		String infService = Context.LAYOUT_INFLATER_SERVICE;
		LayoutInflater li = (LayoutInflater)context.getSystemService(infService);
		li.inflate(R.layout.profiledatarow, this, true);
		
		this.data = data;
		this.optional = optional;
		
		initializeControls();
		
	}

	private void initializeControls() {
		
		dataTv = (TextView) findViewById(R.id.tvNickNameProfDataRow);
		optionalTv = (TextView) findViewById(R.id.tvOptionalProfDataRow);
		
		dataTv.setText(data);
		
		if(optional != null)
			optionalTv.setText(optional);
	}




//	@Override
//	public void setSelected(boolean selected) {
//		super.setSelected(selected);
//
//		if(selected)
//		{
//			Drawable d = new ColorDrawable(Color.GRAY);
//			d.setAlpha(128);
//			setBackgroundDrawable(d);
//		}
//		else
//		{
//			setBackgroundDrawable(null);
//		}
//	}

	
	public TextView getDataTv() {
		return dataTv;
	}

	public void setDataTv(TextView dataTv) {
		this.dataTv = dataTv;
	}

	public TextView getOptionalTv() {
		return optionalTv;
	}

	public void setOptionalTv(TextView optionalTv) {
		this.optionalTv = optionalTv;
	}

	public String getData() {
		return data;
	}

	public void setData(String data) {
		this.data = data;
	}
	
	 

}
